# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=ruby-ast-tdl
_gemname=${pkgname#ruby-}
pkgver=0.2.4
pkgrel=0
pkgdesc="Training Description Language for Artificial Sport Trainer"
url="https://github.com/firefly-cpp/ast-tdl"
arch="noarch"
license="MIT"
depends="ruby ruby-enum"
checkdepends="ruby-minitest"
source="$pkgname-$pkgver.tar.gz::https://github.com/firefly-cpp/$_gemname/archive/$pkgver/$_gemname-$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	ruby test/test_ast_tdl.rb
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files.
	cd "$gemdir"
	rm -r cache/ build_info/ doc/
}

sha512sums="
4b9e42915c5fb28bee60649918d4598641e8fac4fbf4d22e05af67a051232fdda97e145953c598edbecd057214e9f9c84c1f48429c1ae928c370a77edeaccdd0  ruby-ast-tdl-0.2.4.tar.gz
"
